package io.zhoujie.modules.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.zhoujie.modules.app.dao.AppActiveDao;
import io.zhoujie.modules.app.entity.AppActiveEntity;
import io.zhoujie.modules.app.service.AppActiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author zhoujie
 * @email 813685764@qq.com
 * @date 2024-02-20 12:10:43
 */
@Service("AppActiveService")
@Slf4j
public class AppActiveServiceImpl extends ServiceImpl<AppActiveDao, AppActiveEntity>  implements AppActiveService {
    @Autowired
    private AppActiveDao appActiveDao;
    @Override
    public List<AppActiveEntity> queryByStatus(Integer status) {
        return appActiveDao.queryByStatus(status);
    }

    @Override
    public int insertActiveByUid(Integer userId, Integer activeId) {
        return appActiveDao.insertActiveByUid(userId,activeId);
    }

    @Override
    public Map<Object, Object> selectActiveInfo(Integer userId, Integer activeId) {
        Map<Object, Object> map = appActiveDao.selectActiveInfo(userId, activeId);
        return map;
    }

    @Override
    public List<AppActiveEntity> selectUserActive(Integer userId) {
        return appActiveDao.selectListActiveByUser(userId);
    }

    @Override
    public int deletePartActive(Integer userId, Integer activeId) {
        return appActiveDao.deleteByActive(userId,activeId);
    }
}
